<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Contact_form extends CI_Controller 
{	
	public function index()
	{
		$this->load->library('email');		
        $this->email->from($_POST['email'], $_POST['name']);
        $this->email->to('musonepnk@gmail.com');
        $this->email->subject('Gửi từ contact form của adshop');
        $this->email->message($_POST['content']);
        $this->email->send();
        
        $this->session->set_flashdata('message', 'Thư gửi thành công!');
        redirect('');
	}
}